package cn.tedu.eg3;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;

@Component
public class ShopController {
    private String comment;
    public ShopController() {
        System.out.println("1:生命周期实例化");
    }
@Value("商品属性")
    public void setComment(String comment) {
        this.comment = comment;
    System.out.println("2:生命周期属性赋值");
    }
    @PostConstruct
    public void init(){
        System.out.println("3:生命周期初始化");
    }
    @PreDestroy
    public void destroy(){
        System.out.println("5:生命周期销毁方法");
    }
}
